package com.jvup.gameshow.model.viewModel.impl;

import android.widget.Adapter;

import androidx.lifecycle.MutableLiveData;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.jvup.common.support.base.BaseViewModel;
import com.jvup.gameshow.BR;
import com.jvup.common.widget.adapter.auto.SummerBindAdapter;
import com.jvup.common.widget.adapter.auto.SummerRecyclerBindAdapter;
import com.qire.antsrouter.lifecycleHandler.ActivityManageHandler;

import java.util.ArrayList;

public class IdeaDetailViewModel extends BaseViewModel<IdeaDetailViewModel> {

    private ArrayList pictureItemViewModelList = new ArrayList();
    private ArrayList commentItemViewModelList = new ArrayList();

    private final SummerRecyclerBindAdapter pictureAdapter = new SummerRecyclerBindAdapter(pictureItemViewModelList);
    private final SummerBindAdapter commentAdapter = new SummerBindAdapter(commentItemViewModelList);

    @Override
    public int getVariableId() {
        return BR.ideaDetailViewModel;
    }

    public MutableLiveData<CharSequence> getIdeaContent(){
        return get("ideaContent");
    }

    /**
     * 图片展示RecyclerView的布局管理，这里使用3列规格的网格布局
     * @return 布局管理器
     */
    public RecyclerView.LayoutManager getLayoutManager() {
        return new GridLayoutManager(ActivityManageHandler.HANDLER.currentActivity(),3,GridLayoutManager.VERTICAL,false);
    }

    /**
     * 图片展示RecyclerView的数据适配器
     * @return 适配器
     */
    public RecyclerView.Adapter getPictureAdapter(){
        return pictureAdapter;
    }

    /**
     * 评论ListView的数据适配器
     */
    public Adapter getCommentAdapter(){
        return commentAdapter;
    }

} 
